var _util = require('util/util.js');


//文档接口
var _account_service = {
    
    checkLogin: function (resolve, reject) {
        _util.request({
            url: _util.getServerURL('account/getAccountInfo'),
            method: 'POST',
            success: resolve,
            error: reject
        });
    },
    login: function (account, resolve, reject) {
        _util.request({
            url: _util.getServerURL('account/login'),
            data: account,
            method: 'POST',
            success: resolve,
            error: reject
        });
    },
    logout: function (resolve, reject) {
        _util.request({
            url: _util.getServerURL('account/logout'),

            method: 'POST',
            success: resolve,
            error: reject
        });
    },
    regist: function (newaccount,resolve, reject) {
        _util.request({
            url: _util.getServerURL('account/register_account'),
            data: account,
            method: 'POST',
            success: resolve,
            error: reject
        });
    }
};

module.exports =_account_service;